import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.function.UnaryOperator;

public class Test {
    public static String createFIFO(long id) {
        String idLen = "" + ("" + id).length();
        int len = 2 - idLen.length();
        while (len-- > 0)
            idLen = "0" + idLen;
        return idLen + "|" + id;
    }

    public static String stripFIFO(String zid) {
        return zid.substring(zid.indexOf('|') + 1);
    }

    public static void testThread(){
        new Thread(()->{
            System.out.println(Thread.currentThread().getName().concat(" : run"));
        }).start() ;
    }

    public void test(){
        Executors.newFixedThreadPool(100, new ThreadFactory() {
            @Override
            public Thread newThread(Runnable r) {
                Thread thread = new Thread(r) ;
                //线程为守护线程，当程序退出时，java会回收守护线程
                thread.setDaemon(true);
                return thread ;
            }
        }) ;
    }

    public static void main(String[] args) {
        System.out.println(createFIFO(10l)) ;

        System.out.println(stripFIFO("02|10"));

        System.out.println(Thread.currentThread().getName());

        testThread();

        List<String> test = Arrays.asList("a","b","d") ;
        test.spliterator() ;

    }
}
